package com.rao.travel.controller;

import com.rao.travel.pojo.SysLog;
import com.rao.travel.service.SysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

/**
 * @author Srao
 * @version 1.0
 * @className SysLogController
 * @date 2019/11/5 23:00
 * @package com.rao.travel.controller
 * @description
 */
@Controller
@RequestMapping("/sysLog")
public class SysLogController {

    @Autowired
    private SysLogService sysLogService;

    /*查询所有日志信息*/
    @RequestMapping("/findAll.do")
    public ModelAndView findAll(){
        ModelAndView modelAndView = new ModelAndView();
        List<SysLog> sysLogs = sysLogService.findAll();
        modelAndView.addObject("sysLogs", sysLogs);
        modelAndView.setViewName("syslog-list");
        return modelAndView;
    }

}
